package main

import (
	"fmt"
	"github.com/gin-gonic/gin"
	"io"
	"log"
	"net/http"
	"os"
)

func main(){
	router := gin.Default()

	//创建日志文件
	file,_ := os.Create("gin_pro.log")
	gin.DefaultWriter = io.MultiWriter(file)

	router.GET("/hello", func(ctx *gin.Context) {
		path := ctx.FullPath()
		log.Fatal(path)
		fmt.Println(path)
		ctx.String(http.StatusOK,path)
		return
	})
	router.Run()
}


